$(function () {
    nav();

    function nav() {
        currently();
        /*监听所有的点击事件，触发导航标记*/
        $(document).on("click", function () {
            currently();
        });

        /*导航标记当前页*/
        function currently() {
            var locHash = window.location.hash;
            var hash = locHash.replace(/[/]/g, "");

            $(".navList_li>a").each(function (index, el) {
                var href = $(this).attr("href").replace(/[/]/g, "");
                if (href == hash) {
                    var a = $(this).parent().find('.subNavBox').length;
                    if (a != 0) {
                        return
                    }
                    /*$(".navList_li>a").removeClass("hover");
                    $(this).addClass("hover");*/
                }
            });
        }

        $(".navList_li").hover(function () {
            /*导航子菜单弹动显示，需要引用SuperSlideJS*/
            $(this).children('.subNavBox').stop().slideDown({queue: false, duration: 400, easing: 'easeOutBounce'});
        }, function () {
            $(this).children('.subNavBox').stop().slideUp({queue: false, duration: 400, easing: 'easeOutBounce'});
        });
    }

    $(".part").hover(function () {
        $(this).children('.partList').fadeIn(500);
    }, function () {
        $(this).children('.partList').fadeOut(500);
    });

    $(".partList").hover(function () {
        $(this).fadeIn(500);
    },function () {
        $(this).fadeOut(500);
    });

    $(".custom").hover(function () {
        $(this).children('.customList').fadeIn(500);

    }, function () {
        $(this).children('.customList').fadeOut(500);
    });

    $(".customList").hover(function () {
        $(this).fadeIn(500);
    },function () {
        $(this).fadeOut(500);
    });

    /*回到顶部*/
    $(window).scroll(function () {
        if ($(window).scrollTop() >= 150) {
            $('.backTop').fadeIn(300);
        } else {
            $('.backTop').hide();
        }
    });

});